package com.lzhl.imaging.ui;

import javax.swing.*;
import java.awt.*;

/**
 * @author 李柱良(@柱子的日月)
 * @date 2014/8/27
 */
public class AboutUI extends DialogUI {

    public AboutUI(Frame owner) {
        super(owner, "关于", true);

        jbinit();

        pack();
        setLocationRelativeTo(owner);
        setVisible(true);
    }

    private void jbinit() {
        JPanel container = (JPanel) getContentPane();
        container.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        container.setLayout(new BorderLayout());

        Box box = Box.createVerticalBox();
        container.add(box, BorderLayout.CENTER);

        JLabel lb;
        JTextField tf;

        Box boxAuthor = Box.createHorizontalBox();
        box.add(boxAuthor);
        lb = new JLabel("作者：");
        boxAuthor.add(lb);
        tf = new JTextField("@柱子的日月");
        tf.setPreferredSize(new Dimension(200, 20));
        tf.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        tf.setEditable(false);
        boxAuthor.add(tf);
        boxAuthor.add(Box.createHorizontalGlue());

        Box boxVersion = Box.createHorizontalBox();
        box.add(boxVersion);
        lb = new JLabel("版本：");
        boxVersion.add(lb);
        tf = new JTextField("1.00");
        tf.setPreferredSize(new Dimension(200, 20));
        tf.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        tf.setEditable(false);
        boxVersion.add(tf);
        boxVersion.add(Box.createHorizontalGlue());

        Box boxDate = Box.createHorizontalBox();
        box.add(boxDate);
        lb = new JLabel("日期：");
        boxDate.add(lb);
        tf = new JTextField("2014/08/30");
        tf.setPreferredSize(new Dimension(200, 20));
        tf.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        tf.setEditable(false);
        boxDate.add(tf);
        boxDate.add(Box.createHorizontalGlue());

        Box boxAddr = Box.createHorizontalBox();
        box.add(boxAddr);
        lb = new JLabel("地址：");
        boxAddr.add(lb);
        tf = new JTextField("https://git.oschina.net/34335376/Imaging");
        tf.setPreferredSize(new Dimension(300, 20));
        tf.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        tf.setEditable(false);
        boxAddr.add(tf);
        boxAddr.add(Box.createHorizontalGlue());
    }

}
